package com.an.framework.security.deal;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;

/**
 * ClassName: LogoutSuccessHandler <br/>
 * Function: 登出成功处理器. <br/>
 * Reason: 登出成功处理器. <br/>
 * date: 2017年11月8日 下午7:45:51 <br/>
 *
 * @author atc
 * @version 1.0.0
 * @since JDK 1.8
 */
public class MyLogoutSuccessHandler implements LogoutSuccessHandler {

	private static final Logger log = LoggerFactory.getLogger(MyLogoutSuccessHandler.class);
	/**
	 * 登出成功处理.
	 * 
	 * @see org.springframework.security.web.authentication.logout.LogoutSuccessHandler#onLogoutSuccess(javax.servlet.http.HttpServletRequest,
	 *      javax.servlet.http.HttpServletResponse,
	 *      org.springframework.security.core.Authentication)
	 */
	public void onLogoutSuccess(HttpServletRequest arg0, HttpServletResponse arg1, Authentication arg2)
			throws IOException, ServletException {

		log.debug("处理登出成功，跳转到的登出成功页面");
		arg0.getRequestDispatcher("logout-success").forward(arg0, arg1);
	}

}
